package com.platform.common.core.domain.model;

import com.platform.common.core.domain.entity.SysUser;
import com.platform.common.core.domain.entity.WebUser;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.Date;
import java.util.Set;

/**
 * @author Huangkai
 */
@Data
public class WebLoginUser implements UserDetails {
    private static final long serialVersionUID = 1L;

    private String uid;

    /**
     * token
     */
    private String token;

    private WebUser webUser;

    /** 最后登录时间 */
    private Date loginDate;

    /**
     * 登录时间
     */
    private Long loginTime;

    /**
     * 过期时间
     */
    private Long expireTime;

    /**
     * 登录IP地址
     */
    private String ipaddr;

    /**
     * 登录地点
     */
    private String loginLocation;

    /**
     * 浏览器类型
     */
    private String browser;

    /**
     * 操作系统
     */
    private String os;


    public WebLoginUser(String uid, WebUser webUser) {
        this.uid = uid;
        this.webUser = webUser;
    }


    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return null;
    }

    @Override
    public String getUsername() {
        return null;
    }

    @Override
    public boolean isAccountNonExpired() {
        return false;
    }

    @Override
    public boolean isAccountNonLocked() {
        return false;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return false;
    }

    @Override
    public boolean isEnabled() {
        return false;
    }
}
